package bid.yanhj.common.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

/**
 * 工程常量类.
 * 
 */
public class Constants {
	/**
	 * log.
	 */
	private static final Logger LOG = LoggerFactory.getLogger(Constants.class);
	/**
	 * 未知错误.
	 */
	public static final String UNKONW = "未知错误";
	/**
	 * 匿名用户.
	 */
	public static final String ANONYMOUS = "anonymous";
    /**
     * Session中的当前用户.
     */
    public static final String USER_SESSION = "USER_SESSION";
    /**
     * init method.
     */
    @SuppressWarnings("unused")
    private void init() {
    }

    @Value("${ftp.core.host}")
    private String ftp_core_host;
    @Value("${ftp.core.port}")
    private int ftp_core_port;
    @Value("${ftp.core.username}")
    private String ftp_core_username;
    @Value("${ftp.core.password}")
    private String ftp_core_password;
    @Value("${ftp.core.remotepath}")
    private String ftp_core_remotepath;
    
    /**
     * 
     * @author yanhaijiang
     *
     */
    public static class Base {
    	
    }
    
    /**
     * 
     * @author yanhaijiang
     *
     */
    public static class CacheKey {
        /**
         * KEY.
         */
        public static final String RESULT_KEY = "_result_";

        /**
         * tag.
         */
        public static final String META_KEY = "_metainfo_";

        public static final String REQUEST_PARAMTERS_KEY = "_paramters_";
    }
    
    /**
     * 
     * @author yanhaijiang
     *
     */
    public static class ResultCode {
        /**
         * ERR_MSG.
         */
        public static final String[] ERR_MSG = {
                "success", // 00
                "未知原因", // 01
                "请求参数格式错误", // 02
                "找不到符合的订单", // 03
                "生成订单号失败，请稍候再试", // 04
                "找不到对应的还款账单", // 05
                "json格式转换错误", // 06
                "远程请求失败", // 07
                "新增订单失败", // 08
                "订单验证失败", // 09
                "订单支付明确失败", // 10
                "订单取消", // 11
                "订单回滚中", // 10
                "订单回滚完成", // 11
                "业务渠道格式错误"
        };
        public static final int SUCCESS = 0;
        public static final int ERR_UNKOWN = 1;
        public static final int ERR_REQUEST_PARAM_ERROR = 2;
        public static final int ERR_CANNOT_FIND_ORDER = 3;
        public static final int ERR_FAIL_TO_CREATE_ORDERID = 4;
        public static final int ERR_CANNOT_FIND_BILL = 5;
        public static final int ERR_JSON_PARSE = 6;
        public static final int ERR_REMOTE_REQUEST_FAIL = 7;
        public static final int ERR_DB_INSERT = 8;
        public static final int ERR_ORDER_VERIFY_FAIL = 9;
        public static final int ERR_ORDER_PAY_FAIL = 10;
        public static final int ERR_ORDER_CANCEL = 11;
        public static final int ERR_ORDER_ROLLBACKING = 12;
        public static final int ERR_ORDER_ROLLBACK_COMPLETE = 13;
        public static final int ERR_ORDER_BIZCHANNEL_ERROR = 14;
    }
    
    /**
     * 
     * @author yanhaijiang
     *
     */
    public static class Repay {
        /** GBK编码. */
        public static final String ENDECODE_CHARSET_GBK = "GBK";

        /** UTF-8编码. */
        public static final String ENDECODE_CHARSET_UTF_8 = "UTF-8";

        /** NULL. */
        public static final String STRING_NULL = "null";

        /** 空字符串. */
        public static final String STRING_EMPTY = "";
    }
    
    /**
     * 
     * @author yanhaijiang
     *
     */
    public static class UtilConstants {

        public static final String STRING_NULL = null;
        public static final String STRING_EMPTY = "";
        public static final int IS_SYNC = 1;
    }
    
}
